<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=320,user-scalable=no" />
		<meta name="format-detection" content="telephone=no" />
		<title></title>
		<link rel="stylesheet" href="css/index.css" />
	</head>
	<body>
		
		<div class="super">
			<div class="top">
				<marquee>
					<label>13388888888 夺宝盈利</label>
					<span>200金币</span>
				</marquee>
			</div>
			<div class="title">
				<img src="imgs/index/title.png" />
			</div>
			
			<div class="main">
				<img src="imgs/index/indexlhj.gif" />
			</div>
			
			<div class="login">
				<img src="imgs/index/login.png" />
				<p>新用户首次登录即为注册</p>
			</div>
			<div class="fot">
				<img src="imgs/index/footer.png" />
			</div>
		</div>
		
		
		<div class="fix" style="display: none;">
			<div class="flogin" style="display: none;">
				<div class="fixclose"></div>
				<img class="fixbgimg" src="imgs/index/loginbg.png" />
				<div class="form">
					<input type="tel" class="phone" placeholder="请输入您的手机号" />
					<p>
						<input type="text" class="imgcode" placeholder="输入图片的数字" />
						<img class="getnew" src="http://test.wuyouchuxing.com/api/v1/laohu/get_code" />
					</p>
					<p>
						<input type="text" class="checkcode" placeholder="请输入验证码" />
						<img class="getmescode" src="imgs/index/btn_checkcode.png" />
						<span class="timeout">60s</span>
					</p>
					<img class="btnlogin" src="imgs/index/btn_login.png" />
					<ol>
						<li>新用户首次登录即完成注册；</li>
						<li>手机号就是您的登录帐号；</li>
						<li>图形验证码看不清请点击图片更换；</li>
						<li>若出现系统维护请耐心等待；</li>
						<li>每天限登录 5 次，超过请次日登录;</li>
					</ol>
				</div>
			</div>
			
			
		</div>
		
		<div class="tip">
			<div>1111</div>
		</div>
		
		
	</body>
	
	<script type="text/javascript" src="js/jquery-1.12.3.min.js" ></script>
	<script>
		$(".fixclose").on("click", function(){
			$(".fix > div").hide();
			$(".fix").hide();
		});
		$(".main img,.login img").on("click", function(){
			openLogin();
		});
		
		
		function openLogin(){
			$(".fix .flogin").show();
			$(".fix").show();
			absCenter(".flogin");
		}
		
		
		
		function absCenter(ci){
			var sh = $(".super").height();
			var h = $(ci).height();
			$(ci).css("top", (sh-h)/2);
		}
		
	</script>
	
	
	<script>
		// 看不清验证码
		$(".getnew").on("click",function(){
			$(this).attr("src", "http://test.wuyouchuxing.com/api/v1/laohu/get_code");
		});
		var seti = null;
		var time = 60;
		$(".getmescode").on("click", function(){
			console.log("111")
			if (!check()) {
				return;
			}
			
			if (!window.getcodeing) {
				window.getcodeing = true;
				console.log("22")
				$(".timeout").css("display", "inline-block");
				seti = setInterval(function(){
					time--;
					$(".timeout").text(time + "s");
					if (time == -1) {
						$(".timeout").css("display", "none");
						window.getcodeing = false;
						clearInterval(seti);
						time = 60;
					}
				}, 1000);
				
				getCkcode();
			}
		});
		
		function check(){
			if (!(/^1\d{10}$/.test($(".phone").val()))) {
				showTip("手机号有误！");
				return false;
			}
			if (!(/^[A-Za-z0-9]{4}$/.test($(".imgcode").val()))) {
				showTip("验证码格式有误！");
				return false;
			}
			return true;
		}
		
		function getCkcode(){
			$.ajax({
				type:"post",
				url:"http://test.wuyouchuxing.com/api/v1/laohu/send_code",
				async:true,
				data:{
					tel:$(".phone").val(),
					code: $(".imgcode").val(),
					source: "m41",
					pid: 0,
				},
				success: function(){
					
				}
			});
		}
		
		
		
		function showTip(txt){
			$(".tip div").text(txt);
			$(".tip").css("display", "block");
			$(".tip").css("opacity", "1");
			hideTip();
		}
		
		function hideTip(txt){
			setTimeout(function(){
				$(".tip").css("opacity", "1");
				setTimeout(function(){
					$(".tip").css("display", "none");
				},300);
			}, 1000)
		}
		
	</script>
	
	
</html>
